<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div>
    激活码：<span id="code">jspangcom123456</span>
    <button id="btn">复制激活码</button>
  </div>
</body>
<script>
  /*
  * clipboard 都可以在主进程和渲染进程中 使用
  */
  const { clipboard } = require('electron')
  const code = document.querySelector('#code')
  const btn = document.querySelector('#btn')

  btn.onclick = function () {
    clipboard.writeText(code.innerHTML)
    new window.Notification('复制成功', { title: '复制成功', body: 'hello world' })
  }
  
</script>
</html>